<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/plugins/webuploader/webuploader.css" rel="stylesheet" type="text/css" />
<style>
.uploader-list li{
	float:left;
	list-style:none;
	margin-left:5px;

}
.uploader-demo{
border-top:1px solid 00F
} 
</style>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						
						<form class="form-horizontal m-t" id="signupForm" enctype="multipart/form-data">
							<!-- <input id="cid" name="cid" type="hidden"> -->
						<input id="productId" name="productId" th:value="${product.productId}"  type="hidden">
							<div class="form-group">
								<label class="col-sm-1 control-label">商品名称：</label>
								<div class="col-sm-4">
									<input id="name" name="name" th:value="${product.name}" class="form-control" type="text">
								</div>
								
								<label class="col-sm-1 control-label">商品类型：</label>
								<div class="col-sm-4">
									<input id="categoryId" name="categoryId" class="hidden" th:value="${product.categoryId}">
									 <input
										id="categoryName" name="categoryName" th:value="${product.categoryName}"   class="form-control" type="text"
										style="cursor: pointer;" onclick="openCategory()"
										readonly="readonly" placeholder="所属分类">
								</div>
							</div>
							<div class="form-group">	
								<label class="col-sm-3 control-label">显示价格：</label>
								<div class="col-sm-8">
									<input id="showPrice" name="showPrice" th:value="${product.showPrice}" class="form-control" type="text">
								</div>
							</div>
								<div class="form-group">
								<label class="col-sm-1 control-label">商品Logo：</label>
								
								<div class="col-sm-11">
									
									<div id="uploader-demo" class="col-sm-8">
								       <!--用来存放item，图片列表fileList-->
								       <div  class="col-sm-6">
									       <ul  id="fileone" class="uploader-list">
									       	 
									       	 <li  id="productId" class="file-item thumbnail">
							                   <img alt="image" class="img-responsive" th:src="${product.picImg}" width="80px" height="80">
							                    <div class="info"></div>
							                  </li>
									       </ul>
								      </div>
								       <div id="filePicker2" >添加Logo</div>
								       </div>
									</div>
								<input id="picImg" name="picImg" class="form-control" type="hidden" th:value="${product.picImg}">	
							</div>
								<div class="form-group">
								<label class="col-sm-1 control-label">商品图片：</label>
								
								<div class="col-sm-11">
									
									<div id="uploader-demo" class="col-sm-8">
								       <!--用来存放item，图片列表fileList-->
								       <div  class="col-sm-6">
								       <ul  id="fileList" class="uploader-list">
								       		  <!-- <li th:each="img:${imglist}"
								       		  
								       		   th:text="${img}"></li>  --> 
								       		  <li th:each="img:${imgs}"  id="productId2" class="file-item thumbnail">
							                   <img alt="image" class="img-responsive" th:src="${img}" width="100px" height="100">
							                    <div class="info"></div>
							                  </li>
								       		  
								       </ul>
								      </div>
								       <div id="filePicker" >选择图片</div>
								       </div>
									</div>
									<input id="proimgs" name="proimgs" class="form-control" type="hidden" th:value="${product.proimgs}">
							</div>
								<div class="form-group">
								<label class="col-sm-2 control-label">是否上架：</label>
								<div class="switch onoffswitch col-sm-1">
									<div class="onoffswitch">
										<input id="showInShelve" name="showInShelve" checked=""
											type="checkbox" value="1" class="onoffswitch-checkbox"
											id="example1"> <label class="onoffswitch-label"
											for="example1"> <span class="onoffswitch-inner"></span>
											<span class="onoffswitch-switch"></span>
										</label>
									</div>
								</div>

								<label class="col-sm-2 control-label">允许订阅：</label>
								<div class="switch onoffswitch col-sm-2">
									<div class="onoffswitch">
										<input id="allowFeed" name="allowFeed" type="checkbox"
											value="1" class="onoffswitch-checkbox" id="example3">
										<label class="onoffswitch-label" for="example3"> <span
											class="onoffswitch-inner"></span> <span
											class="onoffswitch-switch"></span>
										</label>
									</div>
								</div>
								<input id="status" name="status" type="hidden">
							</div>
							<div class="form-group">
								<input id="pageDescription" name="pageDescription" th:value="${product.pageDescription}" type="hidden"> <label
									class="col-sm-1 control-label">内容：</label>
								<div class="col-sm-11">
									<div class="ibox-content no-padding">
										<div id="content_sn" class="summernote"></div>
									</div>
								</div>
							</div>
						<!-- 	<div class="form-group">
								<label class="col-sm-1 control-label">类型：</label>
								<div class="col-sm-11">
									<input id="categories" name="categories" class="form-control" type="text">
								</div>
							</div> -->
						
							<div class="text-right form-group">
								<a class="btn btn-default waves-effect waves-light"
									onclick="returnList()">返回列表</a>
								<button type="button"
									class="btn btn-primary waves-effect waves-light" type="submit">保存商品</button>
								<button type="button"
									class="btn btn-warning waves-effect waves-light"
									onclick="save(0)">预览</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/plugins/webuploader/webuploader.min.js"></script>
	<script src="/js/vue.min.js"></script>
	<script type="text/javascript" src="/js/common/web-upload-object.js"></script>
	<script type="text/javascript" src="/js/appjs/shop/product/upload.js">	</script>
	<script type="text/javascript" src="/js/appjs/shop/product/uploadpic.js">	</script>
		<script type="text/javascript" src="/js/appjs/shop/common/category/category-tree.js"></script>
	<script type="text/javascript" src="/js/appjs/shop/product/edit.js">	</script>
	
</body>
</html>
